Computer virtualization is a technique that involves encapsulating a representation of a physical computing machine platform into a virtual machine (VM) that is executed under the control of virtualization software running on hardware computing platforms (also referred to herein as “host computing systems” or “servers”). A group of hardware computing platforms may be organized as a cluster to provide the hardware resources, such as memory, central processing units (CPUs) and so on, for VMs/workloads.
Typically the architected address space of a CPU is much larger than the physical memory provided in a computer system. It is known in the art to map memory pages from the virtual architected address space to physical memory. Memory pages of the virtual address space are known as virtual memory pages. Further, memory pages of physical memory are known as physical memory pages. Both virtual and physical memory pages are referenced by page numbers, so a virtual page number may be referred to as a VPN, and a physical page number may be referred to as a PPN. Typically VPNs are mapped to PPNs, but VPN address space may also be swapped out to persistent storage, and managed using other mechanism known in the art.
In a virtualized computing environment a second level of mapping is required. Logically, the VPN within a guest is mapped twice in order to determine which physical memory page of the hardware memory is to be accessed. The first mapping may be provided by the guest operating system (OS) running inside the VM, which translates the guest VPN (GVPN) into a corresponding guest PPN (GPPN). The second mapping may be provided by taking the GPPN used by the guest OS and mapping it to a hardware PPN that can be used to address the physical memory. As is known in the art, it is possible to condense these mappings via a shadow page table. It is also known in the art for CPUs to provide hardware support for multiple mappings by providing nested page tables.
Multiple VMs may have physical memory pages having identical content, particularly for program and OS code. For example, if multiple VMs are running the same guest OS, the same portions of the OS code may be resident in physical memory pages at the same time for execution within different VMs. Thus, for a particular page of OS code, there may be multiple copies of portions of the OS code stored in multiple host computing systems.
To reduce memory overhead, existing methods can reclaim physical memory pages having identical contents, leaving only a single copy of the physical memory page to be shared by the multiple VMs. This is known in the art as transparent memory sharing, and is achieved by changing the GPPN to hardware PPN memory mappings for the VMs having physical memory pages with identical contents to point to the same physical memory page.
The drawings described herein are for illustration purposes only and are not intended to limit the scope of the present subject matter in any way.